import React, { Component } from "react";
import { Form, Input, Modal, DatePicker, Upload, Button } from "antd";
import moment from "moment";
import "moment/locale/zh-cn";
moment.locale("zh-cn");

const { RangePicker } = DatePicker;
const { TextArea } = Input;
class AddUserForm extends Component {
    state = {
        fileName: "",
        flag: 0,
    };
    render() {
        const { visible, onCancel, onOk, form, confirmLoading } = this.props;
        const { getFieldDecorator, setFieldsValue } = form;
        const formItemLayout = {
            labelCol: {
                sm: { span: 6 },
            },
            wrapperCol: {
                sm: { span: 16 },
            },
        };
        // const disabledDate = (current) =>
        //     (current && current > moment().endOf("day")) ||
        //     current < moment().subtract(6, "months");
        // console.log(Upload);
        return (
            <Modal
                title="编辑"
                visible={visible}
                onCancel={onCancel}
                onOk={onOk}
                confirmLoading={confirmLoading}
            >
                <Form {...formItemLayout}>
                    <Form.Item label="用户名:">
                        {getFieldDecorator("userName", { rules: [{ required: true }] })(
                            <Input placeholder="登录用户名" />
                        )}
                    </Form.Item>
                    <Form.Item label="密码:">
                        {getFieldDecorator("userPassword", { rules: [{ required: true }] })(
                            <Input placeholder="登录密码" />
                        )}
                    </Form.Item>
                    <Form.Item label="校验密码:">
                        {getFieldDecorator("checkPassword", { rules: [{ required: true }] })(
                            <Input type={'password'}/>
                        )}
                    </Form.Item>
                </Form>
            </Modal>
        );
    }
}

export default Form.create({ name: "AddUserForm" })(AddUserForm);
